Technical computing environments, such as the environments provided by MATLAB® software, STATEFLOW® software and SIMULINK® software all from The MathWorks, Inc. of Natick Mass., as well as parallel state machines hybrid automata, data flow models (e.g., synchronous data flow models) and other graphical modeling formalisms such as, for example, Petri nets, provide environments for designing, simulating and executing dynamic system models. The models may be models of real-time and/or non-real-time control systems, real-time and/or non-real-time communication systems and other real time and/or non-real-time applications.
Dynamic system models may model multi-task systems that can include tasks/components that execute independently potentially at different rates and/or with different priorities. For example, in a block diagram model, the model may include blocks related to tasks in the system being modeled that execute at different rates (e.g., a first block that executes at a first rate and a second block that executes at a second rate). Blocks and/or components in a system being modeled are frequently required to write to, or read from, a memory location or other resource. In certain situations, one block/component may attempt to read from a memory location while another block/component writes to the location. When multiple blocks/components attempt to interact with a memory location at the same time, problems may arise (e.g., a block may read partially overwritten data from the memory location). For example, if the first block has a sample time that causes it to execute every 0.2 seconds and the second block has a sample time of 0.1 seconds, problems can arise if both the first block and second block are independently executing and attempting to access a shared memory location (the sample-time is the time interval at which the inputs, state, or outputs of the system are updated and/or traced as time progresses). Similarly, parallel state machine states that are active in parallel or parallel transitions may also write to the same memory location.